home *** CD-ROM | disk | FTP | other *** search
/ Hacker 3 / HACKER03.ISO / Igre / Quake Goodies / Botovi.exe / ZEUS10 / SOURCE.ZIP / BOTAI.QC < prev    next >
Encoding:
Text File  |  1996-08-03  |  36.2 KB  |  1,110 lines

  1. /*
  2. ==============================================================================
  3.  
  4. BOT AI
  5.  
  6. ==============================================================================
  7. */
  8.  
  9. float   teleport_dist   = 1500;
  10.  
  11. // Prototypes
  12.  
  13. float   ()                                             BotFindTarget;
  14. void    ()                                             bot_ai_stand;
  15. void    (entity attacker, float damage)                bot_pain;
  16. void    ()                                             bot_die;
  17. void    ()                                             BotSightSound;
  18. void    ()                                             BotFoundTarget;
  19. void    ()                                             BotHuntTarget;
  20. void    (float dist)                                   bot_ai_walk;
  21. void    (float dist)                                   man_bot_ai_walk;
  22. void    ()                                             bot_ai_turn;
  23. void    (float dist)                                   bot_ai_run;
  24. void    (float dist)                                   man_bot_ai_run;
  25. void    (float dist)                                   bot_ai_follow;
  26. void    (void () thinkst)                              BotCheckRefire;
  27. void    ()                                             BotSelfDeActivate;
  28.  
  29. // lightning firing routines
  30. void    ()                                             bot_fire;
  31. void    ()                                             bot_fire2;
  32.  
  33. // nail firing routines
  34. void    ()                                             Bot_FireNails;
  35. void    (vector offset)                                Bot_EnforcerFire;
  36. void    (vector org, vector dir)                       launch_spike;
  37. void    (vector org, vector dir)                       Bot_LaunchSpike;
  38. void    ()                                             spike_touch;
  39.  
  40. void    ()                                             Bot_TeleportToOwner;
  41.  
  42. // Frame macros
  43.  
  44. $cd /raid/quake/id1/models/enforcer
  45. $origin 0 -6 24
  46. $base base
  47. $skin skin
  48.  
  49. $frame stand1 stand2 stand3 stand4 stand5 stand6 stand7
  50.  
  51. $frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10
  52. $frame walk11 walk12 walk13 walk14 walk15 walk16
  53.  
  54. $frame run1 run2 run3 run4 run5 run6 run7 run8
  55.  
  56. $frame attack1 attack2 attack3 attack4 attack5 attack6
  57. $frame attack7 attack8 attack9 attack10
  58.  
  59. $frame death1 death2 death3 death4 death5 death6 death7 death8
  60. $frame death9 death10 death11 death12 death13 death14
  61.  
  62. $frame fdeath1 fdeath2 fdeath3 fdeath4 fdeath5 fdeath6 fdeath7 fdeath8
  63. $frame fdeath9 fdeath10 fdeath11
  64.  
  65. $frame paina1 paina2 paina3 paina4
  66.  
  67. $frame painb1 painb2 painb3 painb4 painb5
  68.  
  69. $frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8
  70.  
  71. $frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8
  72. $frame paind9 paind10 paind11 paind12 paind13 paind14 paind15 paind16
  73. $frame paind17 paind18 paind19
  74.  
  75. void()    bot_stand1    =[    $stand1,    bot_stand2    ] {bot_ai_stand();};
  76. void()    bot_stand2    =[    $stand2,    bot_stand3    ] {bot_ai_stand();};
  77. void()    bot_stand3    =[    $stand3,    bot_stand4    ] {bot_ai_stand();};
  78. void()    bot_stand4    =[    $stand4,    bot_stand5    ] {bot_ai_stand();};
  79. void()    bot_stand5    =[    $stand5,    bot_stand6    ] {bot_ai_stand();};
  80. void()    bot_stand6    =[    $stand6,    bot_stand7    ] {bot_ai_stand();};
  81. void()    bot_stand7    =[    $stand7,    bot_stand1    ] {bot_ai_stand();};
  82.  
  83. void()    man_bot_stand1    =[    $stand1,    man_bot_stand2    ] {ChangeYaw();};
  84. void()    man_bot_stand2    =[    $stand2,    man_bot_stand3    ] {ChangeYaw();};
  85. void()    man_bot_stand3    =[    $stand3,    man_bot_stand4    ] {ChangeYaw();};
  86. void()    man_bot_stand4    =[    $stand4,    man_bot_stand5    ] {ChangeYaw();};
  87. void()    man_bot_stand5    =[    $stand5,    man_bot_stand6    ] {ChangeYaw();};
  88. void()    man_bot_stand6    =[    $stand6,    man_bot_stand7    ] {ChangeYaw();};
  89. void()    man_bot_stand7    =[    $stand7,    man_bot_stand1    ] {ChangeYaw();};
  90.  
  91. void()    man_bot_walk1    =[    $walk1 ,    man_bot_walk2    ]
  92. {
  93.     if (random() < 0.2)
  94.         sound (self, CHAN_VOICE, "enforcer/idle1.wav", 1, ATTN_IDLE);
  95.     man_bot_ai_walk(3);
  96. };
  97. void()    man_bot_walk2    =[    $walk2 ,    man_bot_walk3    ] {man_bot_ai_walk(5);};
  98. void()    man_bot_walk3    =[    $walk3 ,    man_bot_walk4    ] {man_bot_ai_walk(5);};
  99. void()    man_bot_walk4    =[    $walk4 ,    man_bot_walk5    ] {man_bot_ai_walk(4);};
  100. void()    man_bot_walk5    =[    $walk5 ,    man_bot_walk6    ] {man_bot_ai_walk(2);};
  101. void()    man_bot_walk6    =[    $walk6 ,    man_bot_walk7    ] {man_bot_ai_walk(3);};
  102. void()    man_bot_walk7    =[    $walk7 ,    man_bot_walk8    ] {man_bot_ai_walk(3);};
  103. void()    man_bot_walk8    =[    $walk8 ,    man_bot_walk9    ] {man_bot_ai_walk(2);};
  104. void()    man_bot_walk9    =[    $walk9 ,    man_bot_walk10    ] {man_bot_ai_walk(3);};
  105. void()    man_bot_walk10    =[    $walk10,    man_bot_walk11    ] {man_bot_ai_walk(5);};
  106. void()    man_bot_walk11    =[    $walk11,    man_bot_walk12    ] {man_bot_ai_walk(5);};
  107. void()    man_bot_walk12    =[    $walk12,    man_bot_walk13    ] {man_bot_ai_walk(2);};
  108. void()    man_bot_walk13    =[    $walk13,    man_bot_walk14    ] {man_bot_ai_walk(3);};
  109. void()    man_bot_walk14    =[    $walk14,    man_bot_walk15    ] {man_bot_ai_walk(4);};
  110. void()    man_bot_walk15    =[    $walk15,    man_bot_walk16    ] {man_bot_ai_walk(5);};
  111. void()    man_bot_walk16    =[    $walk16,    man_bot_walk1    ] {man_bot_ai_walk(3);};
  112.  
  113. void()    bot_walk1    =[    $walk1 ,    bot_walk2    ]
  114. {
  115.     if (random() < 0.2)
  116.         sound (self, CHAN_VOICE, "enforcer/idle1.wav", 1, ATTN_IDLE);
  117.     bot_ai_walk(4);
  118. };
  119. void()    bot_walk2    =[    $walk2 ,    bot_walk3    ] {bot_ai_walk(8);};
  120. void()    bot_walk3    =[    $walk3 ,    bot_walk4    ] {bot_ai_walk(8);};
  121. void()    bot_walk4    =[    $walk4 ,    bot_walk5    ] {bot_ai_walk(6);};
  122. void()    bot_walk5    =[    $walk5 ,    bot_walk6    ] {bot_ai_walk(2);};
  123. void()    bot_walk6    =[    $walk6 ,    bot_walk7    ] {bot_ai_walk(4);};
  124. void()    bot_walk7    =[    $walk7 ,    bot_walk8    ] {bot_ai_walk(4);};
  125. void()    bot_walk8    =[    $walk8 ,    bot_walk9    ] {bot_ai_walk(2);};
  126. void()    bot_walk9    =[    $walk9 ,    bot_walk10    ] {bot_ai_walk(4);};
  127. void()    bot_walk10    =[    $walk10,    bot_walk11    ] {bot_ai_walk(8);};
  128. void()    bot_walk11    =[    $walk11,    bot_walk12    ] {bot_ai_walk(8);};
  129. void()    bot_walk12    =[    $walk12,    bot_walk13    ] {bot_ai_walk(2);};
  130. void()    bot_walk13    =[    $walk13,    bot_walk14    ] {bot_ai_walk(4);};
  131. void()    bot_walk14    =[    $walk14,    bot_walk15    ] {bot_ai_walk(6);};
  132. void()    bot_walk15    =[    $walk15,    bot_walk16    ] {bot_ai_walk(8);};
  133. void()    bot_walk16    =[    $walk16,    bot_walk1    ] {bot_ai_walk(4);};
  134.  
  135. void()    bot_run1    =[    $run1  ,    bot_run2    ]
  136. {
  137.     if (random() < 0.2)
  138.         sound (self, CHAN_VOICE, "enforcer/idle1.wav", 1, ATTN_IDLE);
  139.     bot_ai_run(18);
  140. };
  141. void()    bot_run2    =[    $run2  ,    bot_run3    ] {bot_ai_run(14);};
  142. void()    bot_run3    =[    $run3  ,    bot_run4    ] {bot_ai_run(7);};
  143. void()    bot_run4    =[    $run4  ,    bot_run5    ] {bot_ai_run(12);};
  144. void()    bot_run5    =[    $run5  ,    bot_run6    ] {bot_ai_run(14);};
  145. void()    bot_run6    =[    $run6  ,    bot_run7    ] {bot_ai_run(14);};
  146. void()    bot_run7    =[    $run7  ,    bot_run8    ] {bot_ai_run(7);};
  147. void()    bot_run8    =[    $run8  ,    bot_run1    ] {bot_ai_run(11);};
  148.  
  149. void()    man_bot_run1    =[    $run1  ,    man_bot_run2    ]
  150. {
  151.     if (random() < 0.2)
  152.         sound (self, CHAN_VOICE, "enforcer/idle1.wav", 1, ATTN_IDLE);
  153.     man_bot_ai_run(18);
  154. };
  155. void()    man_bot_run2    =[    $run2  ,    man_bot_run3    ] {man_bot_ai_run(14);};
  156. void()    man_bot_run3    =[    $run3  ,    man_bot_run4    ] {man_bot_ai_run(7);};
  157. void()    man_bot_run4    =[    $run4  ,    man_bot_run5    ] {man_bot_ai_run(12);};
  158. void()    man_bot_run5    =[    $run5  ,    man_bot_run6    ] {man_bot_ai_run(14);};
  159. void()    man_bot_run6    =[    $run6  ,    man_bot_run7    ] {man_bot_ai_run(14);};
  160. void()    man_bot_run7    =[    $run7  ,    man_bot_run8    ] {man_bot_ai_run(7);};
  161. void()    man_bot_run8    =[    $run8  ,    man_bot_run1    ] {man_bot_ai_run(11);};
  162.  
  163. void()    bot_follow1    =[    $run1  ,    bot_follow2    ]
  164. {
  165.     if (random() < 0.2)
  166.         sound (self, CHAN_VOICE, "enforcer/idle1.wav", 1, ATTN_IDLE);
  167.     self.goalentity = self.movetarget = self.owner;
  168.     bot_ai_follow(18);
  169. };
  170. void()    bot_follow2    =[    $run2  ,    bot_follow3    ] {bot_ai_follow(14);};
  171. void()    bot_follow3    =[    $run3  ,    bot_follow4    ] {bot_ai_follow(7);};
  172. void()    bot_follow4    =[    $run4  ,    bot_follow5    ] {bot_ai_follow(12);};
  173. void()    bot_follow5    =[    $run5  ,    bot_follow6    ] {bot_ai_follow(14);};
  174. void()    bot_follow6    =[    $run6  ,    bot_follow7    ] {bot_ai_follow(14);};
  175. void()    bot_follow7    =[    $run7  ,    bot_follow8    ] {bot_ai_follow(7);};
  176. void()    bot_follow8    =[    $run8  ,    bot_follow1    ] {bot_ai_follow(11);};
  177.  
  178. void()    bot_atk1    =[    $attack1,    bot_atk2    ] {ai_face();};
  179. void()    bot_atk2    =[    $attack2,    bot_atk3    ] {ai_face();};
  180. void()    bot_atk3    =[    $attack3,    bot_atk4    ] {ai_face();};
  181. void()    bot_atk4    =[    $attack4,    bot_atk5    ] {ai_face();};
  182. void()    bot_atk5    =[    $attack5,    bot_atk6    ] {ai_face();};
  183.  
  184. void()  bot_atk6        =[      $attack6,       bot_atk7        ] {bot_fire2();};
  185. void()  bot_atk7        =[      $attack6,       bot_atk8        ] {bot_fire();};
  186. void()  bot_atk8        =[      $attack5,       bot_atk9        ] {bot_fire2();};
  187. void()  bot_atk9        =[      $attack6,       bot_atk10       ] {bot_fire();};
  188. void()  bot_atk10       =[      $attack5,       bot_atk11       ] {bot_fire2();};
  189. void()  bot_atk11       =[      $attack6,       bot_atk12       ] {bot_fire();};
  190. void()  bot_atk12       =[      $attack5,       bot_atk13       ] {bot_fire2();};
  191. void()  bot_atk13       =[      $attack6,       bot_atk14       ] {bot_fire();};
  192. void()  bot_atk14       =[      $attack5,       bot_atk15       ] {bot_fire2();};
  193. void()  bot_atk15       =[      $attack6,       bot_atk16       ] {bot_fire2();};
  194. void()  bot_atk16       =[      $attack5,       bot_atk17       ] {bot_fire();};
  195. void()  bot_atk17       =[      $attack6,       bot_atk18       ] {bot_fire2();};
  196.  
  197. void()  bot_atk18       =[      $attack7,       bot_atk19       ] {ai_face();};
  198. void()  bot_atk19       =[      $attack8,       bot_atk20       ] {ai_face();};
  199. void()  bot_atk20       =[      $attack9,       bot_atk21       ] {ai_face();};
  200. void()  bot_atk21       =[      $attack10,      bot_run1        ]
  201.  
  202. {
  203.     ai_face();
  204.     BotCheckRefire (bot_atk1);
  205. };
  206.  
  207. void()    bot_paina1    =[    $paina1,    bot_paina2    ] {};
  208. void()    bot_paina2    =[    $paina2,    bot_paina3    ] {};
  209. void()    bot_paina3    =[    $paina3,    bot_paina4    ] {};
  210. void()    bot_paina4    =[    $paina4,    bot_run1    ] {};
  211.  
  212. void()    bot_painb1    =[    $painb1,    bot_painb2    ] {};
  213. void()    bot_painb2    =[    $painb2,    bot_painb3    ] {};
  214. void()    bot_painb3    =[    $painb3,    bot_painb4    ] {};
  215. void()    bot_painb4    =[    $painb4,    bot_painb5    ] {};
  216. void()    bot_painb5    =[    $painb5,    bot_run1    ] {};
  217.  
  218. void()    bot_painc1    =[    $painc1,    bot_painc2    ] {};
  219. void()    bot_painc2    =[    $painc2,    bot_painc3    ] {};
  220. void()    bot_painc3    =[    $painc3,    bot_painc4    ] {};
  221. void()    bot_painc4    =[    $painc4,    bot_painc5    ] {};
  222. void()    bot_painc5    =[    $painc5,    bot_painc6    ] {};
  223. void()    bot_painc6    =[    $painc6,    bot_painc7    ] {};
  224. void()    bot_painc7    =[    $painc7,    bot_painc8    ] {};
  225. void()    bot_painc8    =[    $painc8,    bot_run1    ] {};
  226.  
  227. void()    bot_paind1    =[    $paind1,    bot_paind2    ] {};
  228. void()    bot_paind2    =[    $paind2,    bot_paind3    ] {};
  229. void()    bot_paind3    =[    $paind3,    bot_paind4    ] {};
  230. void()    bot_paind4    =[    $paind4,    bot_paind5    ] {ai_painforward(2);};
  231. void()    bot_paind5    =[    $paind5,    bot_paind6    ] {ai_painforward(1);};
  232. void()    bot_paind6    =[    $paind6,    bot_paind7    ] {};
  233. void()    bot_paind7    =[    $paind7,    bot_paind8    ] {};
  234. void()    bot_paind8    =[    $paind8,    bot_paind9    ] {};
  235. void()    bot_paind9    =[    $paind9,    bot_paind10    ] {};
  236. void()    bot_paind10    =[    $paind10,    bot_paind11    ] {};
  237. void()    bot_paind11    =[    $paind11,    bot_paind12    ] {ai_painforward(1);};
  238. void()    bot_paind12    =[    $paind12,    bot_paind13    ] {ai_painforward(1);};
  239. void()    bot_paind13    =[    $paind13,    bot_paind14    ] {ai_painforward(1);};
  240. void()    bot_paind14    =[    $paind14,    bot_paind15    ] {};
  241. void()    bot_paind15    =[    $paind15,    bot_paind16    ] {};
  242. void()    bot_paind16    =[    $paind16,    bot_paind17    ] {ai_pain(1);};
  243. void()    bot_paind17    =[    $paind17,    bot_paind18    ] {ai_pain(1);};
  244. void()    bot_paind18    =[    $paind18,    bot_paind19    ] {};
  245. void()    bot_paind19    =[    $paind19,    bot_run1    ] {};
  246.  
  247. void()    bot_die1    =[    $death1,    bot_die2    ] {};
  248. void()    bot_die2    =[    $death2,    bot_die3    ] {};
  249. void()    bot_die3    =[    $death3,    bot_die4    ]
  250. {
  251.     self.solid = SOLID_NOT;
  252.     self.ammo_cells = 5;
  253.     DropBackpack();
  254. };
  255. void()    bot_die4    =[    $death4,    bot_die5    ] {ai_forward(14);};
  256. void()    bot_die5    =[    $death5,    bot_die6    ] {ai_forward(2);};
  257. void()    bot_die6    =[    $death6,    bot_die7    ] {};
  258. void()    bot_die7    =[    $death7,    bot_die8    ] {};
  259. void()    bot_die8    =[    $death8,    bot_die9    ] {};
  260. void()    bot_die9    =[    $death9,    bot_die10    ] {ai_forward(3);};
  261. void()    bot_die10    =[    $death10,    bot_die11    ] {ai_forward(5);};
  262. void()    bot_die11    =[    $death11,    bot_die12    ] {ai_forward(5);};
  263. void()    bot_die12    =[    $death12,    bot_die13    ] {ai_forward(5);};
  264. void()    bot_die13    =[    $death13,    bot_die14    ] {};
  265. void()    bot_die14    =[    $death14,    bot_die14    ] {BotSelfDeActivate();};
  266.  
  267. void()    bot_fdie1    =[    $fdeath1,    bot_fdie2    ] {};
  268. void()    bot_fdie2    =[    $fdeath2,    bot_fdie3    ] {};
  269. void()    bot_fdie3    =[    $fdeath3,    bot_fdie4    ] 
  270. {
  271.     self.solid = SOLID_NOT;
  272.     self.ammo_cells = 5;
  273.     DropBackpack();
  274. };
  275. void()    bot_fdie4    =[    $fdeath4,    bot_fdie5    ] {};
  276. void()    bot_fdie5    =[    $fdeath5,    bot_fdie6    ] {};
  277. void()    bot_fdie6    =[    $fdeath6,    bot_fdie7    ] {};
  278. void()    bot_fdie7    =[    $fdeath7,    bot_fdie8    ] {};
  279. void()    bot_fdie8    =[    $fdeath8,    bot_fdie9    ] {};
  280. void()    bot_fdie9    =[    $fdeath9,    bot_fdie10    ] {};
  281. void()    bot_fdie10    =[    $fdeath10,    bot_fdie11    ] {};
  282. void()    bot_fdie11    =[    $fdeath11,    bot_fdie11    ] {BotSelfDeActivate();};
  283.  
  284.  
  285.  
  286. //=============================================================
  287. // BotFindTarget
  288. // Self is currently not attacking anything, so try to find a target
  289. // Will not currently target other players
  290. // Sets self.enemy and returns TRUE if an enemy was sighted
  291. // Sets self.enemy to world and returns FALSE if no enemy sighted
  292. //=============================================================
  293. /*
  294.         Old Code
  295.  
  296. float() BotFindTarget =
  297. {
  298.         local entity head, selected;
  299.     local float dist;
  300.         local float r;
  301.  
  302.     dist = 1500;    // awareness radius of bot, increasing it slows down game
  303.     selected = world;
  304.  
  305.     head = findradius(self.origin, 1500);
  306.     while(head)
  307.     {
  308. // Original code
  309. //           if(!(head.flags & FL_NOTARGET) && (head.flags & FL_MONSTER))
  310.              if(!(head.flags & FL_NOTARGET) && ((head.flags & FL_CLIENT) || (head.flags & FL_MONSTER)))
  311.                 if (((teamplay) &&  (head.team != self.owner.team)) || (!teamplay))
  312.                 if ((head.health > 1) && (head != self) && (head.bot != self))
  313.                 if (visible(head))
  314.                 if (trace_plane_dist < dist)
  315.                 if ((head.health > 0) && (head !=self))
  316.                    {
  317.                         selected = head;
  318.                         dist = trace_plane_dist;
  319.                    }
  320.         head = head.chain;
  321.     }
  322.     self.enemy = selected;
  323.         
  324.     if (self.enemy == world)
  325.         {
  326.                 sprint(self.owner, "World\n");
  327.         return FALSE;
  328.         }
  329.         else
  330.                 if (selected.bot == self)
  331.                         {
  332.                         // were all centerprint
  333.                                 sprint(self.owner, "Doh, thats ");
  334.                                 sprint(self.owner, selected.owner.netname);
  335.                                 sprint(self.owner, "\n");
  336.                                 return FALSE;
  337.                         }
  338.                 else
  339.                         if (teamplay == 1)
  340.                      {
  341.                           if (selected.team == self.team)
  342.                                        {
  343.                                               sprint(self.owner, "Doh, thats my friend ");
  344.                                               sprint(self.owner, selected.owner.netname);
  345.                                               sprint(self.owner, "\n");
  346.                                               return FALSE;
  347.                                         }
  348.                           else
  349.                           sprint(self.owner, "Die interloper!\n");
  350.                           BotFoundTarget();
  351.                           return TRUE;
  352.                       }
  353.         else
  354.         {
  355.                 r = random ();
  356.  
  357.                 if (r < 0.25)
  358.                 {
  359.                         sprint(self.owner, "Die interloper!\n");
  360.                 }
  361.                 else if (r < 0.50)
  362.                 {
  363.                         sprint(self.owner, "Eat me, loser!\n");
  364.                 }
  365.                 else if (r < 0.75)
  366.                 {
  367.                         sprint(self.owner, "Meet Zeus, mortal!\n");
  368.                 }
  369.                 else                 {
  370.                         sprint(self.owner, "Initiating capitol punishment...\n");
  371.                 }
  372.         BotFoundTarget();
  373.         return TRUE;
  374.     }
  375. };
  376. */
  377. // New Code
  378. float() BotFindTarget =
  379. {
  380.         local entity head, selected;
  381.     local float dist;
  382.     dist = 1500;    // awareness radius of bot, increasing it slows down game
  383.     selected = world;
  384.  
  385.     head = findradius(self.origin, 1500);
  386.     while(head)
  387.     {
  388. //           if(!(head.flags & FL_NOTARGET) && (head.flags & FL_MONSTER)) Original Code
  389. // Old Code if(!(head.flags & FL_NOTARGET) && ((head.flags & FL_CLIENT) || (head.flags & FL_MONSTER)))
  390.                 if(!(head.flags & FL_NOTARGET) && ((head.flags & FL_CLIENT) || (head.flags & FL_MONSTER)))
  391.                 if (((teamplay) &&  (head.team != self.owner.team)) || (!teamplay))
  392.                 if ((head.health > 1) && (head != self) && (head.bot != self))
  393.                 if (visible(head))
  394.                 if (trace_plane_dist < dist)
  395.                 if ((head.health > 0) && (head !=self))
  396.                    {
  397.                         selected = head;
  398.                         dist = trace_plane_dist;
  399.                    }
  400.         head = head.chain;
  401.     }
  402.     self.enemy = selected;
  403.         
  404.     if (self.enemy == world)
  405.         return FALSE;
  406.         else
  407. /*      if (self.enemy.bot == self)
  408. //              return FALSE;
  409. //      else
  410. //      if (teamplay == 1)
  411. //              {
  412. //                if (self.enemy.team == self.team)
  413. //                   {
  414. //  No Longer         self.enemy = world;
  415. //  Needed I Hope    return FALSE;
  416. //                   }
  417. //                else
  418. // Modified by Silvar
  419. //                   {
  420. //                    BotFoundTarget();
  421. //                    return TRUE;
  422. //                   }
  423. //             }
  424. //      else
  425. */
  426.         {
  427.         BotFoundTarget();
  428.         return TRUE;
  429.     }
  430. };
  431. // end new code
  432. //=============================================================
  433. // bot_ai_stand - bot stands in place until target acquired,
  434. // and starts to walk if pausetime has expired
  435. //=============================================================
  436. void() bot_ai_stand =
  437. {
  438.     if (BotFindTarget ())
  439.         return;
  440.     
  441.     if (vlen (self.origin - self.owner.origin) > 100)
  442.     {
  443.         bot_follow1    ();
  444.         return;
  445.     }
  446.     else if (vlen (self.origin - self.owner.origin) > teleport_dist)
  447.         {
  448.           Bot_TeleportToOwner ();
  449.         }
  450.  
  451.     if (time > self.pausetime)
  452.     {
  453.                 self.th_walk (); /* was self.th_walk */
  454.         return;
  455.     }
  456. };
  457.  
  458.  
  459. //=============================================================
  460. // bot_pain
  461. //=============================================================
  462. void(entity attacker, float damage)    bot_pain =
  463. {
  464.     local float r;
  465.     local entity oldself;
  466.  
  467.     r = random ();
  468.     if (self.pain_finished > time)
  469.         return;
  470.  
  471.  
  472.     if (r < 0.5)
  473.         sound (self, CHAN_VOICE, "enforcer/pain1.wav", 1, ATTN_NORM);
  474.     else
  475.         sound (self, CHAN_VOICE, "enforcer/pain2.wav", 1, ATTN_NORM);
  476.  
  477.  
  478. // Been hit, so go into automatic mode
  479.     if (!(self.owner.bot_auto))
  480.     {
  481.         oldself = self;
  482.         self = self.owner;
  483.         BotAutoToggle();
  484.         self = oldself;
  485. //                self.enemy = attacker.owner;
  486. //                BotFoundTarget();
  487.     }
  488.  
  489.     if (r < 0.2)
  490.     {
  491.         self.pain_finished = time + 1;
  492.         bot_paina1 ();
  493.     }
  494.     else if (r < 0.4)
  495.     {
  496.         self.pain_finished = time + 1;
  497.         bot_painb1 ();
  498.     }
  499.     else if (r < 0.7)
  500.     {
  501.         self.pain_finished = time + 1;
  502.         bot_painc1 ();
  503.     }
  504.     else
  505.     {
  506.         self.pain_finished = time + 2;
  507.         bot_paind1 ();
  508.     }
  509.  
  510. };
  511.  
  512. //=============================================================
  513. // bot_die
  514. //=============================================================
  515. void() bot_die =
  516. {
  517.     sound (self, CHAN_VOICE, "enforcer/death1.wav", 1, ATTN_NORM);
  518.     if (random() > 0.5)
  519.         bot_die1 ();
  520.     else
  521.         bot_fdie1 ();
  522.  
  523. // death frame sequence includes bot deactivation    
  524. };
  525.  
  526.  
  527. //=============================================================
  528. // BotSightSound
  529. //=============================================================
  530. void() BotSightSound =
  531. {
  532.     local float    rsnd;
  533.  
  534.     rsnd = rint(random() * 3);
  535.     if (rsnd == 1)
  536.         sound (self, CHAN_VOICE, "enforcer/sight1.wav", 1, ATTN_NORM);
  537.     else if (rsnd == 2)
  538.         sound (self, CHAN_VOICE, "enforcer/sight2.wav", 1, ATTN_NORM);
  539.     else if (rsnd == 0)
  540.         sound (self, CHAN_VOICE, "enforcer/sight3.wav", 1, ATTN_NORM);
  541.     else
  542.         sound (self, CHAN_VOICE, "enforcer/sight4.wav", 1, ATTN_NORM);
  543. };
  544.  
  545.  
  546. //=============================================================
  547. // BotHuntTarget
  548. //=============================================================
  549. void() BotHuntTarget =
  550. {
  551.     self.goalentity = self.enemy;
  552.     self.think = self.th_run;
  553.     self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin);
  554.     self.nextthink = time + 0.1;
  555.         SUB_AttackFinished (0.1);       // wait a while before first attack
  556. };
  557.  
  558.  
  559. //=============================================================
  560. // BotFoundTarget
  561. //=============================================================
  562. void() BotFoundTarget =
  563. {
  564.     local float   f_dist;
  565.     local string  s_dist;
  566.         local float   r;
  567.         local string  newname;
  568.  
  569.     f_dist = vlen (self.enemy.origin - self.origin);
  570.     s_dist = ftos (f_dist);
  571.  
  572.     self.show_hostile = time + 1;        // wake up other monsters
  573.  
  574. /*
  575.     sprint (self.owner, "targetting: ");
  576.         if (self.enemy.classname == "player")
  577.             {
  578.               sprint (self.owner, self.enemy.netname);
  579.             }
  580.         else
  581.     sprint (self.owner, self.enemy.classname);
  582.     sprint (self.owner, "\n");
  583.     sprint (self.owner, "  distance: ");
  584.     sprint (self.owner, s_dist);
  585.     sprint (self.owner, "\n");
  586. */
  587.         newname = "jerk";
  588.         if(self.enemy.classname == "monster_army")
  589.         newname = "jarhead";
  590.         if (self.enemy.classname == "monster_demon1")
  591.         newname = "Fiend";
  592.         if (self.enemy.classname == "monster_dog")
  593.         newname = "Lassie";
  594.         if (self.enemy.classname == "monster_enforcer")
  595.         newname = "you fool";
  596.         if (self.enemy.classname == "monster_fish")
  597.         newname = "you scum sucker";
  598.         if (self.enemy.classname == "monster_hell_knight")
  599.         newname = "you metal freak";
  600.         if (self.enemy.classname == "monster_knight")
  601.         newname = "Tin Man";
  602.         if (self.enemy.classname == "monster_ogre")
  603.         newname = "you hairy brute";
  604.         if (self.enemy.classname == "monster_shalrath")
  605.         newname = "Cinderella";
  606.         if (self.enemy.classname == "monster_shambler")
  607.         newname = "you mutant toddler";
  608.         if (self.enemy.classname == "monster_tarbaby")
  609.         newname = "Tarbaby";
  610.         if (self.enemy.classname == "monster_wizard")
  611.         newname = "you floating puss-bag";
  612.         if (self.enemy.classname == "monster_zombie")
  613.         newname = "Frankenstein";
  614.  
  615.         if (self.enemy.classname == "player")
  616.         {
  617.           r = random ();
  618.  
  619.           if (r < 0.25)
  620.           {
  621.             bprint("Bot: Die,");
  622.             bprint (self.enemy.netname);
  623.             bprint ("!\n");
  624.           }
  625.           else if (r < 0.50)
  626.           {
  627.             bprint("Bot: Eat me,");
  628.             bprint (self.enemy.netname);
  629.             bprint ("!\n");
  630.           }
  631.           else if (r < 0.75)
  632.           {
  633.             bprint("Bot: Meet my friend Zeus,");
  634.             bprint (self.enemy.netname);
  635.             bprint ("!\n");
  636.           }
  637.           else
  638.           {
  639.             bprint("Bot: Subject ");
  640.             bprint (self.enemy.netname);
  641.             bprint (" marked for termination.\n");
  642.           }
  643.         }
  644.         else
  645.         {
  646.           r = random ();
  647.  
  648.           if (r < 0.166)
  649.           {
  650.             sprint(self.owner, "Bot: Die interloper!\n");
  651.           }
  652.           else if (r < 0.332)
  653.           {
  654.             sprint (self.owner, "Bot: Eat me, ");
  655.             sprint (self.owner, newname);
  656.             sprint (self.owner, "!\n");
  657.           }
  658.           else if (r < 0.498)
  659.           {
  660.             sprint(self.owner, "Bot: Meet my friend Zeus, mortal!\n");
  661.           }
  662.           else if (r < 0.664)
  663.           {
  664.             sprint (self.owner, "Bot: Subject ");
  665.             sprint (self.owner, self.enemy.classname);
  666.             sprint (self.owner, " marked for termination.\n");
  667.           }
  668.           else if (r < 0.83)
  669.           {
  670.             sprint (self.owner, "Bot: Taste my shaft, ");
  671.             sprint (self.owner, newname);
  672.             sprint (self.owner, "!\n");
  673.           }
  674.           else
  675.           {
  676.             sprint (self.owner, "Bot: Eat light, ");
  677.             sprint (self.owner, newname);
  678.             sprint (self.owner, "!\n");
  679.           }
  680.         }
  681.  
  682.     BotSightSound ();
  683.     BotHuntTarget ();
  684. };
  685.  
  686.  
  687. //=============================================================
  688. // bot_ai_walk - bot is walking, looking for enemies
  689. //=============================================================
  690. void(float dist) bot_ai_walk =
  691. {
  692.     if (BotFindTarget ())
  693.         return;
  694.  
  695.     if (vlen (self.origin - self.owner.origin) > 100)
  696.     {
  697.         bot_follow1();
  698.         return;
  699.     }
  700.     else if (vlen (self.origin - self.owner.origin) > teleport_dist)
  701.         {
  702.           Bot_TeleportToOwner ();
  703.         }
  704.  
  705.     movetogoal (dist);
  706. };
  707.  
  708.  
  709. //=============================================================
  710. // bot_ai_follow - bot is following player, looking for enemies
  711. //=============================================================
  712. void(float dist) bot_ai_follow =
  713. {
  714.     if (BotFindTarget ())
  715.         return;
  716.  
  717.     if (vlen (self.origin - self.owner.origin) <= 50)
  718.     {
  719.         self.pausetime = time + 2;
  720.         self.th_stand ();
  721.         return;
  722.     }
  723.         else if (vlen (self.origin - self.owner.origin) > teleport_dist)
  724.         {
  725.           Bot_TeleportToOwner ();
  726.         }
  727.  
  728.     movetogoal (dist);
  729. };
  730.  
  731.  
  732. //=============================================================
  733. // man_bot_ai_walk - bot is walking
  734. //=============================================================
  735. void(float dist) man_bot_ai_walk =
  736. {
  737.     local vector    temp_vec;
  738.  
  739.     ChangeYaw();
  740.     makevectors (self.angles);
  741.     temp_vec = vectoangles (v_forward);
  742.     walkmove (temp_vec_y, dist);
  743. };
  744.  
  745.  
  746. //=============================================================
  747. // man_bot_ai_run - bot is running
  748. //=============================================================
  749. void(float dist) man_bot_ai_run =
  750. {
  751.     local entity temp_ent;
  752.     local vector temp_vec;
  753.  
  754.     ChangeYaw();
  755.     makevectors (self.angles);
  756.  
  757.     temp_ent = spawn();
  758.     temp_ent.classname = "navpoint";
  759.     temp_ent.owner = self;
  760.     temp_ent.angles = self.angles;
  761.     temp_ent.nextthink = time + 0.1;
  762.     temp_ent.think = SUB_Remove;
  763.     temp_ent.takedamage = DAMAGE_NO;
  764.     temp_ent.solid = SOLID_NOT;
  765.     temp_ent.movetype = MOVETYPE_NONE;
  766.  
  767.     self.enemy = self.goalentity = self.movetarget = temp_ent;
  768.  
  769.     makevectors (self.angles);
  770.     temp_vec = self.origin + (v_forward * 100);
  771.     setorigin (temp_ent, temp_vec);
  772.  
  773.     movetogoal (dist);
  774. };
  775.  
  776.  
  777. //=============================================================
  778. // bot_ai_turn - turn towards ideal_yaw if no enemy sighted
  779. //=============================================================
  780. void() bot_ai_turn =
  781. {
  782.     if (BotFindTarget ())
  783.         return;
  784.     
  785.     ChangeYaw ();
  786. };
  787.  
  788.  
  789. //=============================================================
  790. // bot_ai_run - still needs a little work
  791. //=============================================================
  792. void(float dist) bot_ai_run =
  793. {
  794.     local    vector    delta;
  795.     local    float    axis;
  796.     local    float    direct, ang_rint, ang_floor, ang_ceil;
  797.     
  798.     movedist = dist;
  799.  
  800.     if (self.enemy.health <= 0)
  801.     {
  802.         self.enemy = world;
  803.         if (self.oldenemy.health > 0)
  804.         {
  805.             self.enemy = self.oldenemy;
  806.             BotHuntTarget ();
  807.         }
  808.         else
  809.         {
  810.             if (BotFindTarget())
  811.                 return;
  812.             else
  813.             {
  814.                 self.movetarget = self.owner;
  815.                 self.th_walk (); /* was self.th_walk */
  816.                 return;
  817.             }
  818.         }
  819.     }
  820.  
  821.     self.show_hostile = time + 1;        // wake up other monsters
  822.  
  823.     enemy_vis = visible(self.enemy);
  824.     if (enemy_vis)
  825.         self.search_time = time + 5;
  826.  
  827.     enemy_infront = infront(self.enemy);
  828.     enemy_range = range(self.enemy);
  829.     enemy_yaw = vectoyaw(self.enemy.origin - self.origin);
  830.     
  831.     if (self.attack_state == AS_MISSILE)
  832.     {
  833.         ai_run_missile ();
  834.         return;
  835.     }
  836.     if (self.attack_state == AS_MELEE)
  837.     {
  838.         ai_run_melee ();
  839.         return;
  840.     }
  841.  
  842.     if (CheckAnyAttack ())
  843.         return;                    // beginning an attack
  844.         
  845.     if (self.attack_state == AS_SLIDING)
  846.     {
  847.         ai_run_slide ();
  848.         return;
  849.     }
  850.         
  851.     movetogoal (dist);        // done in C code...
  852. };
  853.  
  854.  
  855. //=============================================================
  856. // BotCheckRefire
  857. //=============================================================
  858. void (void () thinkst) BotCheckRefire =
  859. {
  860.     if (!visible (self.enemy) || (self.enemy.health <= 0))
  861.         return;
  862.     self.think = thinkst;
  863. };
  864.  
  865.  
  866. //=============================================================
  867. // BotSelfDeActivate - Bot deactivates itself
  868. //=============================================================
  869. void () BotSelfDeActivate =
  870. {
  871.     local entity bot_owner;
  872.     bot_owner = self.owner;
  873.  
  874.     WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
  875.     WriteByte (MSG_BROADCAST, TE_TELEPORT);
  876.     WriteCoord (MSG_BROADCAST, self.origin_x);
  877.     WriteCoord (MSG_BROADCAST, self.origin_y);
  878.     WriteCoord (MSG_BROADCAST, self.origin_z);
  879.     sound (self, CHAN_BODY, "misc/r_tele1.wav", 1, ATTN_NORM);
  880.     remove (self);
  881.     bot_owner.bot_flag = FALSE;
  882.     sprint (bot_owner, "bot deactivated\n");
  883. };
  884.  
  885. /*╔═══════════════════════════════════════════════════════════════════════╗
  886.   ║                                                                       ║
  887.   ║ Start code for firing Lightning                                       ║
  888.   ║                                                                       ║
  889.   ╚═══════════════════════════════════════════════════════════════════════╝*/
  890.  
  891. void() bot_CastLightning =
  892. {
  893.     local    vector    org, dir;
  894.         local float ox;
  895.  
  896.         ox = 4;
  897.  
  898.         // remove muzzle flash effect
  899.     self.effects = self.effects | EF_MUZZLEFLASH;
  900.  
  901. //    ai_face ();
  902.  
  903.         org = self.origin + v_forward * 30 + v_right*ox + '0 0 16';
  904.  
  905.         // dir for Shambler's lightning
  906.     dir = self.enemy.origin + '0 0 16' - org;
  907.  
  908. //        dir = self.enemy.origin - self.origin;
  909.     dir = normalize (dir);
  910.  
  911.     traceline (org, self.origin + dir*600, TRUE, self);
  912.  
  913.     WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
  914.     WriteByte (MSG_BROADCAST, TE_LIGHTNING1);
  915.     WriteEntity (MSG_BROADCAST, self);
  916.     WriteCoord (MSG_BROADCAST, org_x);
  917.     WriteCoord (MSG_BROADCAST, org_y);
  918.     WriteCoord (MSG_BROADCAST, org_z);
  919.     WriteCoord (MSG_BROADCAST, trace_endpos_x);
  920.     WriteCoord (MSG_BROADCAST, trace_endpos_y);
  921.     WriteCoord (MSG_BROADCAST, trace_endpos_z);
  922.  
  923.     LightningDamage (org, trace_endpos, self, 10);
  924. };
  925.  
  926. /*∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙
  927.   ∙                                                                       ∙
  928.   ∙ Bot_Fire                                                              ∙
  929.   ∙                                                                       ∙
  930.   ∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙*/
  931.  
  932. void () bot_fire =
  933. {
  934. // in future, adjust frame sequence to not show firing if auto_fire off
  935.  
  936.     if (self.auto_fire)
  937.     {
  938.                if (!visible (self.enemy) || (self.enemy.health <= 0))
  939.                 return;
  940.                 bot_CastLightning ();
  941.  
  942. // if starting attack, play lstart.wav
  943.                 if (self.attack_finished < time)
  944.                 {
  945.         sound (self, CHAN_WEAPON, "weapons/lstart.wav", 1, ATTN_NORM);
  946.                 self.attack_finished = time + 0.1;
  947.                 }
  948. // if attack is started, and 0.6 secs have passed, play lhit.wav
  949.                 else if (self.t_width < time)
  950.             {
  951.                         sound (self, CHAN_WEAPON, "weapons/lhit.wav", 1, ATTN_NORM);
  952.                         self.t_width = time + 0.6;
  953.                    }
  954.  
  955.                 bot_CastLightning ();
  956.     }
  957.     else
  958.         return;
  959. };
  960.  
  961. /*∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙
  962.   ∙                                                                       ∙
  963.   ∙ Bot_Fire2                                                             ∙
  964.   ∙                                                                       ∙
  965.   ∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙*/
  966.  
  967. void () bot_fire2 =
  968. {
  969. // in future, adjust frame sequence to not show firing if auto_fire off
  970.  
  971.     if (self.auto_fire)
  972.     {
  973.                self.oldenemy = self.enemy;
  974.                if (!visible (self.enemy) || (self.enemy.health <= 0))
  975.                {
  976.                         if (BotFindTarget ())
  977.                                 return;
  978.  
  979.                                 ChangeYaw ();
  980.                   self.enemy = self.oldenemy;
  981.                }
  982.               bot_CastLightning ();
  983. // if starting attack, play lstart.wav
  984.                 if (self.attack_finished < time)
  985.                 {
  986.         sound (self, CHAN_WEAPON, "weapons/lstart.wav", 1, ATTN_NORM);
  987.                 self.attack_finished = time + 0.1;
  988.                 }
  989. // if attack is started, and 0.6 secs have passed, play lhit.wav
  990.                 else if (self.t_width < time)
  991.             {
  992.                         sound (self, CHAN_WEAPON, "weapons/lhit.wav", 1, ATTN_NORM);
  993.                         self.t_width = time + 0.6;
  994.                    }
  995.  
  996.               bot_CastLightning ();
  997.     }
  998.     else
  999.         return;
  1000. };
  1001.  
  1002. /*╔═══════════════════════════════════════════════════════════════════════╗
  1003.   ║                                                                       ║
  1004.   ║ Start code for firing Nailgun                                         ║
  1005.   ║                                                                       ║
  1006.   ╚═══════════════════════════════════════════════════════════════════════╝*/
  1007.  
  1008. void () Bot_FireNails =
  1009. {
  1010. // in future, adjust frame sequence to not show firing if auto_fire off
  1011.  
  1012.     if (self.auto_fire)
  1013.     {
  1014.                self.oldenemy = self.enemy;
  1015.                if (!visible (self.enemy) || (self.enemy.health <= 0))
  1016.                {
  1017.                         if (BotFindTarget ())
  1018.                                 return;
  1019.  
  1020.                                 ChangeYaw ();
  1021.                   self.enemy = self.oldenemy;
  1022.                }
  1023.                Bot_EnforcerFire ('0.01 0.01 0');
  1024.         sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM);
  1025.                Bot_EnforcerFire ('0.01 0 0.01');
  1026.     }
  1027.     else
  1028.         return;
  1029. };
  1030.  
  1031.  
  1032. void(vector offset) Bot_EnforcerFire =
  1033. {
  1034.     local vector org;
  1035.         local vector dir;
  1036.         local float ox;
  1037.  
  1038.         ox = 4;
  1039.  
  1040.     self.effects = self.effects | EF_MUZZLEFLASH;
  1041.     makevectors (self.angles);
  1042.     sound (self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM);
  1043.  
  1044.         org = self.origin + v_forward * 30 + v_right*ox + '0 0 16';
  1045.         dir = self.enemy.origin - self.origin;
  1046.         dir = normalize(dir);
  1047.         launch_spike (org, dir);
  1048.         org = org + offset;
  1049.         launch_spike (org, dir);
  1050.         Bot_LaunchSpike (org, dir);
  1051. };
  1052.  
  1053. void(vector org, vector dir) Bot_LaunchSpike =
  1054. {
  1055.         local   vector  vec, move;
  1056.         local   float   fly, mspeed, accuracy;
  1057.  
  1058.     newmis = spawn ();
  1059.     newmis.owner = self;
  1060.     newmis.movetype = MOVETYPE_FLYMISSILE;
  1061.     newmis.solid = SOLID_BBOX;
  1062.         mspeed = 1000;
  1063.         accuracy = 0.0;
  1064.     makevectors (self.angles);
  1065.                                 // set missile speed
  1066.         vec = self.enemy.origin + self.enemy.mins + self.enemy.size * 0.7 - newmis.origin;
  1067.                                 // calc aproximate time for missile to reach vec
  1068.     fly = vlen (vec) / mspeed;
  1069.                                 // get the entities xy velocity
  1070.     move = self.enemy.velocity;
  1071.     move_z = 0;
  1072.                                 // project the target forward in time
  1073.     vec = vec + move * fly;
  1074.     vec = normalize(vec);
  1075.         vec = vec + accuracy*v_up*(random()- 0.1) + accuracy*v_right*(random()- 0.1);
  1076.         newmis.velocity = vec * mspeed;
  1077.         newmis.angles = '0 0 0';
  1078.         newmis.angles_y = vectoyaw(newmis.velocity);
  1079.                                 // set missile duration
  1080.     newmis.touch = spike_touch;
  1081.     newmis.classname = "spike";
  1082.     newmis.think = SUB_Remove;
  1083.     newmis.nextthink = time + 6;
  1084.     setmodel (newmis, "progs/spike.mdl");
  1085.     setsize (newmis, VEC_ORIGIN, VEC_ORIGIN);
  1086.     setorigin (newmis, org);
  1087.  
  1088. };
  1089.  
  1090. void () Bot_TeleportToOwner =
  1091. {
  1092.         local vector org;
  1093.  
  1094.         sprint (self.owner, "I'm back!\n");
  1095.  
  1096.     spawn_tfog (self.origin);
  1097.     self.ideal_yaw = self.angles * '0 1 0';
  1098.     self.pausetime = time + 2;
  1099.     self.nextthink = time + 0.1;
  1100.     self.think = self.bot.th_stand;
  1101.  
  1102.         org = self.owner.origin + '0 0 0';
  1103.     setorigin(self, org);
  1104.  
  1105.     spawn_tfog (self.origin);
  1106.     self.nextthink = time + 0.1;
  1107.     self.think = self.th_stand;
  1108.     return;
  1109. };
  1110.